package day08;

import java.util.Random;

public class MathDemo03 {
    public static void main(String[] args) {
        // 方法的调用
        // 按照方法名称
        say();
        sayHello(12,"冰冰");
        //sayHello("lily",23); 调用方法 传递参数类型不匹配
        double b = getNum();// 方法返回的是int ，int转成double 是自动转
        System.out.println(b);
        int num = getNum(78);
        System.out.println(num);
        boolean f=flag(3,6);
        System.out.println(f);
    }
    // 修饰词 返回值 方法名（参数）{方法体}
    // public static void name(arg){}
    public static void say(){
        System.out.println("say hello");
    }
    public static void sayHello(int age ,String name){
        System.out.println("你好"+name+",我今年"+age+"岁");
    }
    public static int getNum(){
        Random  random = new Random();
        return random.nextInt(100);
    }

    public static int getNum(int num){
        Random  random = new Random();
        return random.nextInt(num);
    }

    public static boolean flag(int a,int b){
        return  a>b;
    }

}
